From c5a8d2c78b4f6de454294c818a8e18a2d4fd67dd Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Tue, 2 Aug 2005 17:59:20 +0000 Subject: [PATCH] Don't abort on untranslatable errors: EINVAL and print warning Signed-off-by: Rusty Russel Signed-off-by: Christian Limpach --- tools/xenstore/xenstored_core.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c index e257853cb2..ad35ed2f89 100644 --- a/tools/xenstore/xenstored_core.c +++ b/tools/xenstore/xenstored_core.c @@ -504,11 +504,13 @@ void send_error(struct connection *conn, int error) { unsigned int i; - for (i = 0; error != xsd_errors[i].errnum; i++) - if (i == ARRAY_SIZE(xsd_errors) - 1) - corrupt(conn, "Unknown error %i (%s)", error, - strerror(error)); - + for (i = 0; error != xsd_errors[i].errnum; i++) { + if (i == ARRAY_SIZE(xsd_errors) - 1) { + eprintf("xenstored: error %i untranslatable", error); + i = 0; /* EINVAL */ + break; + } + } send_reply(conn, XS_ERROR, xsd_errors[i].errstring, strlen(xsd_errors[i].errstring) + 1); } -- 2.30.2